package com.medata.service.impl;

import com.medata.dataObject.Logdetail;
import com.medata.repository.LogdetailRepository;
import com.medata.service.LogdetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;
import java.sql.Timestamp;

/**
 * @author ：zb
 * @date ：Created in 2019/7/7 0007 12:07
 * @description：
 */
@Service
public class LogdetailServiceImpl implements LogdetailService {
    @Autowired
    private LogdetailRepository repository;

    @Override
    public Page<Logdetail> findByLogtimeBetween(Timestamp startTime, Timestamp endTime, Pageable pageable) {
        return repository.findByLogtimeBetween(startTime,endTime,pageable);
    }

    @Override
    @Transactional
    public void deleteByLogtimeBetween(Timestamp startTime, Timestamp endTime) {
        repository.deleteByLogtimeBetween(startTime,endTime);
    }

    @Override
    public void save(Logdetail logdetail) {
        repository.save(logdetail);
    }
}
